package com.reader.api.pay.processors;

import com.google.common.collect.Maps;
import com.reader.api.constants.PayPlatformTypeEnum;

import java.util.Map;

/**
 * @author liujianqing
 * @date 2018/10/25
 */
public class PayProcessorContent {
    private static Map<PayPlatformTypeEnum, AbstractPayProcessor> processorMap = Maps.newConcurrentMap();

    public static void registProcessor(PayPlatformTypeEnum payTypeEnum, AbstractPayProcessor processor) {
        processorMap.put(payTypeEnum, processor);
    }

    public static AbstractPayProcessor getProcessor(PayPlatformTypeEnum payTypeEnum) {
        return processorMap.get(payTypeEnum);
    }
}
